<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: login/xdh-login.vue</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Source: login/xdh-login.vue</h1>

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>&lt;template>
  &lt;div class="xdh-login">
    &lt;div class="xdh-login__header" v-if="$slots.header || header">
      &lt;slot name="header">{{header}}&lt;/slot>
    &lt;/div>

    &lt;div class="xdh-login__content">
      &lt;div class="xdh-login__login">
        &lt;div class="xdh-login__login--logo">
          &lt;img :src="logo" alt="" height="68">
        &lt;/div>
        &lt;div class="xdh-login__login--block">
          &lt;el-form :model="loginModel" ref="loginForm">
            &lt;el-form-item prop="user" label="用户名">
              &lt;el-input v-model="loginModel.user" placeholder="请输入用户名">&lt;/el-input>
            &lt;/el-form-item>
            &lt;el-form-item prop="password" label="密码">
              &lt;el-input v-model="loginModel.password" placeholder="请输入密码">&lt;/el-input>
            &lt;/el-form-item>
            &lt;el-form-item>
              &lt;div class="xdh-login__login--block__buttons">
                &lt;el-button size="small" type="primary" @click="login">登录&lt;/el-button>
                &lt;el-button size="small" @click="reset">重置&lt;/el-button>
              &lt;/div>
            &lt;/el-form-item>
          &lt;/el-form>
        &lt;/div>
      &lt;/div>
    &lt;/div>

    &lt;div class="xdh-login__footer" v-if="$slots.footer || footer">
      &lt;slot name="footer">{{footer}}&lt;/slot>
    &lt;/div>
  &lt;/div>
&lt;/template>

&lt;script>
  /**
   * 登录页
   * @module extension/login
   */

  /**
   * 插槽
   * @member slots
   * @property {string} header 自定义头部
   * @property {string} header 自定义底部
   */

  /**
   * @export
   */
  export default {
    name: 'XdhLogin',
    /**
     * 属性参数
     * @property {String} [header] 头部文字
     * @property {String} [footer] 底部文字
     */
    props: {
      header: {
        type: String,
        default: '后台管理系统'
      },
      footer: {
        type: String,
        default: '珠海市新德汇信息技术有限公司'
      }
    },
    data() {
      return {
        logo: require('./img/logo.png'),
        loginModel: {
          user: null,
          password: null
        }
      }
    },
    methods: {
      reset() {
        this.loginModel = {
          user: null,
          password: null
        }
      },
      login() {
        if (this.loginModel.user &amp;&amp; this.loginModel.password) {
          this.$emit('on-login', this.loginModel)
        } else {
          this.$message.error('请输入正确的用户名/密码！')
        }
      }
    }
  }
&lt;/script>
</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-extension_charts_bar_xdh-bar-rankings.html">extension/charts/bar/xdh-bar-rankings</a></li><li><a href="module-extension_charts_graph_xdh-flow.html">extension/charts/graph/xdh-flow</a></li><li><a href="module-extension_charts_line_xdh-line-basic.html">extension/charts/line/xdh-line-basic</a></li><li><a href="module-extension_charts_line_xdh-line-stacked.html">extension/charts/line/xdh-line-stacked</a></li><li><a href="module-extension_charts_other_xdh-waterwave.html">extension/charts/other/xdh-waterwave</a></li><li><a href="module-extension_charts_pie_xdh-pie-gauge.html">extension/charts/pie/xdh-pie-gauge</a></li><li><a href="module-extension_charts_pie_xdh-pie-semiring.html">extension/charts/pie/xdh-pie-semiring</a></li><li><a href="module-extension_login.html">extension/login</a></li><li><a href="module-extension_xdh-admin.html">extension/xdh-admin</a></li><li><a href="module-extension_xdh-admin-lte.html">extension/xdh-admin-lte</a></li><li><a href="module-extensions_xdh-exception.html">extensions/xdh-exception</a></li></ul><h3>Events</h3><ul><li><a href="module-extension_xdh-admin.html#~event:header-nav-select">header-nav-select</a></li><li><a href="module-extension_xdh-admin.html#~event:header-search">header-search</a></li><li><a href="module-extension_xdh-admin.html#~event:header-tool-click">header-tool-click</a></li><li><a href="module-extension_xdh-admin-lte.html#~event:menu-select">menu-select</a></li><li><a href="module-extension_xdh-admin.html#~event:sidebar-switch">sidebar-switch</a></li><li><a href="module-extension_xdh-admin-lte.html#~event:tab-click">tab-click</a></li><li><a href="module-extension_xdh-admin-lte.html#~event:tab-remove">tab-remove</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Nov 15 2018 21:31:28 GMT+0800 (China Standard Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>
